FIFA 19 ANALYSIS

IMPORTING MODULES

In [1]:
### FOR MANUPULATION
import numpy as np
import pandas as pd

### FOR VISUALIZATION
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import plotly as py
import plotly.graph_objs as go
import seaborn as sns
from IPython.display import display, HTML, YouTubeVideo
from collections import Counter as counter

print("Modules are imported")
Modules are imported

FIFA19 COVER PHOTO

In [2]:
plt.figure(1, figsize = (20, 15))
img = mpimg.imread("fifa19cover.jpg") 
plt.imshow(img)
plt.show()

LOADING DATASET

In [3]:
df_fifa = pd.read_csv("data.csv")
df_fifa.head(50)
Out[3]:
Unnamed: 0 ID Name Age Photo Nationality Flag Overall Potential Club ... Composure Marking StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning GKReflexes Release Clause
0 0 158023 L. Messi 31 https://cdn.sofifa.org/players/4/19/158023.png Argentina https://cdn.sofifa.org/flags/52.png 94 94 FC Barcelona ... 96.0 33.0 28.0 26.0 6.0 11.0 15.0 14.0 8.0 €226.5M
1 1 20801 Cristiano Ronaldo 33 https://cdn.sofifa.org/players/4/19/20801.png Portugal https://cdn.sofifa.org/flags/38.png 94 94 Juventus ... 95.0 28.0 31.0 23.0 7.0 11.0 15.0 14.0 11.0 €127.1M
2 2 190871 Neymar Jr 26 https://cdn.sofifa.org/players/4/19/190871.png Brazil https://cdn.sofifa.org/flags/54.png 92 93 Paris Saint-Germain ... 94.0 27.0 24.0 33.0 9.0 9.0 15.0 15.0 11.0 €228.1M
3 3 193080 De Gea 27 https://cdn.sofifa.org/players/4/19/193080.png Spain https://cdn.sofifa.org/flags/45.png 91 93 Manchester United ... 68.0 15.0 21.0 13.0 90.0 85.0 87.0 88.0 94.0 €138.6M
4 4 192985 K. De Bruyne 27 https://cdn.sofifa.org/players/4/19/192985.png Belgium https://cdn.sofifa.org/flags/7.png 91 92 Manchester City ... 88.0 68.0 58.0 51.0 15.0 13.0 5.0 10.0 13.0 €196.4M
5 5 183277 E. Hazard 27 https://cdn.sofifa.org/players/4/19/183277.png Belgium https://cdn.sofifa.org/flags/7.png 91 91 Chelsea ... 91.0 34.0 27.0 22.0 11.0 12.0 6.0 8.0 8.0 €172.1M
6 6 177003 L. Modrić 32 https://cdn.sofifa.org/players/4/19/177003.png Croatia https://cdn.sofifa.org/flags/10.png 91 91 Real Madrid ... 84.0 60.0 76.0 73.0 13.0 9.0 7.0 14.0 9.0 €137.4M
7 7 176580 L. Suárez 31 https://cdn.sofifa.org/players/4/19/176580.png Uruguay https://cdn.sofifa.org/flags/60.png 91 91 FC Barcelona ... 85.0 62.0 45.0 38.0 27.0 25.0 31.0 33.0 37.0 €164M
8 8 155862 Sergio Ramos 32 https://cdn.sofifa.org/players/4/19/155862.png Spain https://cdn.sofifa.org/flags/45.png 91 91 Real Madrid ... 82.0 87.0 92.0 91.0 11.0 8.0 9.0 7.0 11.0 €104.6M
9 9 200389 J. Oblak 25 https://cdn.sofifa.org/players/4/19/200389.png Slovenia https://cdn.sofifa.org/flags/44.png 90 93 Atlético Madrid ... 70.0 27.0 12.0 18.0 86.0 92.0 78.0 88.0 89.0 €144.5M
10 10 188545 R. Lewandowski 29 https://cdn.sofifa.org/players/4/19/188545.png Poland https://cdn.sofifa.org/flags/37.png 90 90 FC Bayern München ... 86.0 34.0 42.0 19.0 15.0 6.0 12.0 8.0 10.0 €127.1M
11 11 182521 T. Kroos 28 https://cdn.sofifa.org/players/4/19/182521.png Germany https://cdn.sofifa.org/flags/21.png 90 90 Real Madrid ... 85.0 72.0 79.0 69.0 10.0 11.0 13.0 7.0 10.0 €156.8M
12 12 182493 D. Godín 32 https://cdn.sofifa.org/players/4/19/182493.png Uruguay https://cdn.sofifa.org/flags/60.png 90 90 Atlético Madrid ... 82.0 90.0 89.0 89.0 6.0 8.0 15.0 5.0 15.0 €90.2M
13 13 168542 David Silva 32 https://cdn.sofifa.org/players/4/19/168542.png Spain https://cdn.sofifa.org/flags/45.png 90 90 Manchester City ... 93.0 59.0 53.0 29.0 6.0 15.0 7.0 6.0 12.0 €111M
14 14 215914 N. Kanté 27 https://cdn.sofifa.org/players/4/19/215914.png France https://cdn.sofifa.org/flags/18.png 89 90 Chelsea ... 85.0 90.0 91.0 85.0 15.0 12.0 10.0 7.0 10.0 €121.3M
15 15 211110 P. Dybala 24 https://cdn.sofifa.org/players/4/19/211110.png Argentina https://cdn.sofifa.org/flags/52.png 89 94 Juventus ... 84.0 23.0 20.0 20.0 5.0 4.0 4.0 5.0 8.0 €153.5M
16 16 202126 H. Kane 24 https://cdn.sofifa.org/players/4/19/202126.png England https://cdn.sofifa.org/flags/14.png 89 91 Tottenham Hotspur ... 89.0 56.0 36.0 38.0 8.0 10.0 11.0 14.0 11.0 €160.7M
17 17 194765 A. Griezmann 27 https://cdn.sofifa.org/players/4/19/194765.png France https://cdn.sofifa.org/flags/18.png 89 90 Atlético Madrid ... 87.0 59.0 47.0 48.0 14.0 8.0 14.0 13.0 14.0 €165.8M
18 18 192448 M. ter Stegen 26 https://cdn.sofifa.org/players/4/19/192448.png Germany https://cdn.sofifa.org/flags/21.png 89 92 FC Barcelona ... 69.0 25.0 13.0 10.0 87.0 85.0 88.0 85.0 90.0 €123.3M
19 19 192119 T. Courtois 26 https://cdn.sofifa.org/players/4/19/192119.png Belgium https://cdn.sofifa.org/flags/7.png 89 90 Real Madrid ... 66.0 20.0 18.0 16.0 85.0 91.0 72.0 86.0 88.0 €113.7M
20 20 189511 Sergio Busquets 29 https://cdn.sofifa.org/players/4/19/189511.png Spain https://cdn.sofifa.org/flags/45.png 89 89 FC Barcelona ... 90.0 90.0 86.0 80.0 5.0 8.0 13.0 9.0 13.0 €105.6M
21 21 179813 E. Cavani 31 https://cdn.sofifa.org/players/4/19/179813.png Uruguay https://cdn.sofifa.org/flags/60.png 89 89 Paris Saint-Germain ... 82.0 52.0 45.0 39.0 12.0 5.0 13.0 13.0 10.0 €111M
22 22 167495 M. Neuer 32 https://cdn.sofifa.org/players/4/19/167495.png Germany https://cdn.sofifa.org/flags/21.png 89 89 FC Bayern München ... 70.0 17.0 10.0 11.0 90.0 86.0 91.0 87.0 87.0 €62.7M
23 23 153079 S. Agüero 30 https://cdn.sofifa.org/players/4/19/153079.png Argentina https://cdn.sofifa.org/flags/52.png 89 89 Manchester City ... 90.0 30.0 20.0 12.0 13.0 15.0 6.0 11.0 14.0 €119.3M
24 24 138956 G. Chiellini 33 https://cdn.sofifa.org/players/4/19/138956.png Italy https://cdn.sofifa.org/flags/27.png 89 89 Juventus ... 84.0 93.0 93.0 90.0 3.0 3.0 2.0 4.0 3.0 €44.6M
25 25 231747 K. Mbappé 19 https://cdn.sofifa.org/players/4/19/231747.png France https://cdn.sofifa.org/flags/18.png 88 95 Paris Saint-Germain ... 86.0 34.0 34.0 32.0 13.0 5.0 7.0 11.0 6.0 €166.1M
26 26 209331 M. Salah 26 https://cdn.sofifa.org/players/4/19/209331.png Egypt https://cdn.sofifa.org/flags/111.png 88 89 Liverpool ... 91.0 38.0 43.0 41.0 14.0 14.0 9.0 11.0 14.0 €137.3M
27 27 200145 Casemiro 26 https://cdn.sofifa.org/players/4/19/200145.png Brazil https://cdn.sofifa.org/flags/54.png 88 90 Real Madrid ... 84.0 88.0 90.0 87.0 13.0 14.0 16.0 12.0 12.0 €126.4M
28 28 198710 J. Rodríguez 26 https://cdn.sofifa.org/players/4/19/198710.png Colombia https://cdn.sofifa.org/flags/56.png 88 89 FC Bayern München ... 87.0 52.0 41.0 44.0 15.0 15.0 15.0 5.0 14.0 NaN
29 29 198219 L. Insigne 27 https://cdn.sofifa.org/players/4/19/198219.png Italy https://cdn.sofifa.org/flags/27.png 88 88 Napoli ... 83.0 51.0 24.0 22.0 8.0 4.0 14.0 9.0 10.0 €105.4M
30 30 197781 Isco 26 https://cdn.sofifa.org/players/4/19/197781.png Spain https://cdn.sofifa.org/flags/45.png 88 91 Real Madrid ... 86.0 60.0 64.0 51.0 10.0 8.0 12.0 15.0 6.0 €156.2M
31 31 190460 C. Eriksen 26 https://cdn.sofifa.org/players/4/19/190460.png Denmark https://cdn.sofifa.org/flags/13.png 88 91 Tottenham Hotspur ... 88.0 59.0 57.0 22.0 9.0 14.0 7.0 7.0 6.0 €141.5M
32 32 189242 Coutinho 26 https://cdn.sofifa.org/players/4/19/189242.png Brazil https://cdn.sofifa.org/flags/54.png 88 89 FC Barcelona ... 85.0 55.0 54.0 47.0 12.0 7.0 9.0 14.0 6.0 €147.7M
33 33 188567 P. Aubameyang 29 https://cdn.sofifa.org/players/4/19/188567.png Gabon https://cdn.sofifa.org/flags/115.png 88 88 Arsenal ... 86.0 27.0 25.0 36.0 6.0 9.0 15.0 9.0 9.0 €112.1M
34 34 178603 M. Hummels 29 https://cdn.sofifa.org/players/4/19/178603.png Germany https://cdn.sofifa.org/flags/21.png 88 88 FC Bayern München ... 91.0 88.0 90.0 88.0 15.0 6.0 10.0 5.0 6.0 €75.9M
35 35 176676 Marcelo 30 https://cdn.sofifa.org/players/4/19/176676.png Brazil https://cdn.sofifa.org/flags/54.png 88 88 Real Madrid ... 86.0 71.0 85.0 86.0 12.0 5.0 5.0 5.0 9.0 €88.2M
36 36 173731 G. Bale 28 https://cdn.sofifa.org/players/4/19/173731.png Wales https://cdn.sofifa.org/flags/50.png 88 88 Real Madrid ... 86.0 54.0 55.0 52.0 15.0 15.0 11.0 5.0 6.0 €123M
37 37 167948 H. Lloris 31 https://cdn.sofifa.org/players/4/19/167948.png France https://cdn.sofifa.org/flags/18.png 88 88 Tottenham Hotspur ... 65.0 29.0 10.0 18.0 88.0 84.0 68.0 83.0 92.0 €66.6M
38 38 167664 G. Higuaín 30 https://cdn.sofifa.org/players/4/19/167664.png Argentina https://cdn.sofifa.org/flags/52.png 88 88 Milan ... 86.0 35.0 22.0 18.0 5.0 12.0 7.0 5.0 10.0 NaN
39 39 164240 Thiago Silva 33 https://cdn.sofifa.org/players/4/19/164240.png Brazil https://cdn.sofifa.org/flags/54.png 88 88 Paris Saint-Germain ... 81.0 88.0 89.0 85.0 9.0 12.0 5.0 9.0 10.0 €44.4M
40 40 162835 S. Handanovič 33 https://cdn.sofifa.org/players/4/19/162835.png Slovenia https://cdn.sofifa.org/flags/44.png 88 88 Inter ... 69.0 25.0 10.0 13.0 87.0 86.0 69.0 89.0 89.0 €51M
41 41 1179 G. Buffon 40 https://cdn.sofifa.org/players/4/19/1179.png Italy https://cdn.sofifa.org/flags/27.png 88 88 Paris Saint-Germain ... 70.0 13.0 11.0 11.0 88.0 87.0 74.0 90.0 83.0 €7.4M
42 42 205600 S. Umtiti 24 https://cdn.sofifa.org/players/4/19/205600.png France https://cdn.sofifa.org/flags/18.png 87 92 FC Barcelona ... 82.0 90.0 89.0 86.0 15.0 10.0 14.0 12.0 15.0 €121.1M
43 43 201399 M. Icardi 25 https://cdn.sofifa.org/players/4/19/201399.png Argentina https://cdn.sofifa.org/flags/52.png 87 90 Inter ... 85.0 45.0 24.0 20.0 13.0 9.0 5.0 7.0 9.0 €114.5M
44 44 201024 K. Koulibaly 27 https://cdn.sofifa.org/players/4/19/201024.png Senegal https://cdn.sofifa.org/flags/136.png 87 90 Napoli ... 78.0 91.0 88.0 86.0 7.0 11.0 7.0 13.0 5.0 €90.5M
45 45 195864 P. Pogba 25 https://cdn.sofifa.org/players/4/19/195864.png France https://cdn.sofifa.org/flags/18.png 87 91 Manchester United ... 87.0 66.0 70.0 68.0 5.0 6.0 2.0 4.0 3.0 €123.2M
46 46 193041 K. Navas 31 https://cdn.sofifa.org/players/4/19/193041.png Costa Rica https://cdn.sofifa.org/flags/72.png 87 87 Real Madrid ... 67.0 28.0 14.0 14.0 90.0 81.0 75.0 82.0 90.0 €62.5M
47 47 192505 R. Lukaku 25 https://cdn.sofifa.org/players/4/19/192505.png Belgium https://cdn.sofifa.org/flags/7.png 87 89 Manchester United ... 83.0 30.0 30.0 30.0 8.0 15.0 14.0 7.0 10.0 €120.3M
48 48 192387 C. Immobile 28 https://cdn.sofifa.org/players/4/19/192387.png Italy https://cdn.sofifa.org/flags/27.png 87 87 Lazio ... 81.0 34.0 33.0 32.0 6.0 8.0 15.0 12.0 6.0 €88.4M
49 49 189332 Jordi Alba 29 https://cdn.sofifa.org/players/4/19/189332.png Spain https://cdn.sofifa.org/flags/45.png 87 87 FC Barcelona ... 79.0 72.0 84.0 85.0 13.0 15.0 13.0 6.0 13.0 €77.9M

50 rows × 89 columns

SHAPE OF DATASET(ROW, COLUMNS)

In [4]:
df_fifa.shape
Out[4]:
(18207, 89)

DROPPING UNNECESSARY COLUMNS

In [5]:
useless_cols = ["ID", "Unnamed: 0", "Photo", "Flag", "Club Logo", "Special", "Body Type", "Real Face", "Joined", "Loaned From",
                "Contract Valid Until", "Weight", "LS", "ST", "RS", "LW", "LF", "CF", "RF", "RW", "LAM", "CAM", "RAM", "LM", 
                "LCM", "CM", "RCM", "RM", "LWB", "LDM", "CDM", "RDM", "RWB", "LB", "LCB", "CB", "RCB", "RB", "Release Clause"]
df_fifa.drop(useless_cols, axis=1, inplace=True)
df_fifa.head(10)
Out[5]:
Name Age Nationality Overall Potential Club Value Wage Preferred Foot International Reputation ... Penalties Composure Marking StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning GKReflexes
0 L. Messi 31 Argentina 94 94 FC Barcelona €110.5M €565K Left 5.0 ... 75.0 96.0 33.0 28.0 26.0 6.0 11.0 15.0 14.0 8.0
1 Cristiano Ronaldo 33 Portugal 94 94 Juventus €77M €405K Right 5.0 ... 85.0 95.0 28.0 31.0 23.0 7.0 11.0 15.0 14.0 11.0
2 Neymar Jr 26 Brazil 92 93 Paris Saint-Germain €118.5M €290K Right 5.0 ... 81.0 94.0 27.0 24.0 33.0 9.0 9.0 15.0 15.0 11.0
3 De Gea 27 Spain 91 93 Manchester United €72M €260K Right 4.0 ... 40.0 68.0 15.0 21.0 13.0 90.0 85.0 87.0 88.0 94.0
4 K. De Bruyne 27 Belgium 91 92 Manchester City €102M €355K Right 4.0 ... 79.0 88.0 68.0 58.0 51.0 15.0 13.0 5.0 10.0 13.0
5 E. Hazard 27 Belgium 91 91 Chelsea €93M €340K Right 4.0 ... 86.0 91.0 34.0 27.0 22.0 11.0 12.0 6.0 8.0 8.0
6 L. Modrić 32 Croatia 91 91 Real Madrid €67M €420K Right 4.0 ... 82.0 84.0 60.0 76.0 73.0 13.0 9.0 7.0 14.0 9.0
7 L. Suárez 31 Uruguay 91 91 FC Barcelona €80M €455K Right 5.0 ... 85.0 85.0 62.0 45.0 38.0 27.0 25.0 31.0 33.0 37.0
8 Sergio Ramos 32 Spain 91 91 Real Madrid €51M €380K Right 4.0 ... 75.0 82.0 87.0 92.0 91.0 11.0 8.0 9.0 7.0 11.0
9 J. Oblak 25 Slovenia 90 93 Atlético Madrid €68M €94K Right 3.0 ... 11.0 70.0 27.0 12.0 18.0 86.0 92.0 78.0 88.0 89.0

10 rows × 50 columns

INFORMATION ON DATASET

In [6]:
df_fifa.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 18207 entries, 0 to 18206
Data columns (total 50 columns):
Name                        18207 non-null object
Age                         18207 non-null int64
Nationality                 18207 non-null object
Overall                     18207 non-null int64
Potential                   18207 non-null int64
Club                        17966 non-null object
Value                       18207 non-null object
Wage                        18207 non-null object
Preferred Foot              18159 non-null object
International Reputation    18159 non-null float64
Weak Foot                   18159 non-null float64
Skill Moves                 18159 non-null float64
Work Rate                   18159 non-null object
Position                    18147 non-null object
Jersey Number               18147 non-null float64
Height                      18159 non-null object
Crossing                    18159 non-null float64
Finishing                   18159 non-null float64
HeadingAccuracy             18159 non-null float64
ShortPassing                18159 non-null float64
Volleys                     18159 non-null float64
Dribbling                   18159 non-null float64
Curve                       18159 non-null float64
FKAccuracy                  18159 non-null float64
LongPassing                 18159 non-null float64
BallControl                 18159 non-null float64
Acceleration                18159 non-null float64
SprintSpeed                 18159 non-null float64
Agility                     18159 non-null float64
Reactions                   18159 non-null float64
Balance                     18159 non-null float64
ShotPower                   18159 non-null float64
Jumping                     18159 non-null float64
Stamina                     18159 non-null float64
Strength                    18159 non-null float64
LongShots                   18159 non-null float64
Aggression                  18159 non-null float64
Interceptions               18159 non-null float64
Positioning                 18159 non-null float64
Vision                      18159 non-null float64
Penalties                   18159 non-null float64
Composure                   18159 non-null float64
Marking                     18159 non-null float64
StandingTackle              18159 non-null float64
SlidingTackle               18159 non-null float64
GKDiving                    18159 non-null float64
GKHandling                  18159 non-null float64
GKKicking                   18159 non-null float64
GKPositioning               18159 non-null float64
GKReflexes                  18159 non-null float64
dtypes: float64(38), int64(3), object(9)
memory usage: 6.3+ MB

STATISTICS ON DATASET

In [7]:
df_fifa.describe()
Out[7]:
Age Overall Potential International Reputation Weak Foot Skill Moves Jersey Number Crossing Finishing HeadingAccuracy ... Penalties Composure Marking StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning GKReflexes
count 18207.000000 18207.000000 18207.000000 18159.000000 18159.000000 18159.000000 18147.000000 18159.000000 18159.000000 18159.000000 ... 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000 18159.000000
mean 25.122206 66.238699 71.307299 1.113222 2.947299 2.361308 19.546096 49.734181 45.550911 52.298144 ... 48.548598 58.648274 47.281623 47.697836 45.661435 16.616223 16.391596 16.232061 16.388898 16.710887
std 4.669943 6.908930 6.136496 0.394031 0.660456 0.756164 15.947765 18.364524 19.525820 17.379909 ... 15.704053 11.436133 19.904397 21.664004 21.289135 17.695349 16.906900 16.502864 17.034669 17.955119
min 16.000000 46.000000 48.000000 1.000000 1.000000 1.000000 1.000000 5.000000 2.000000 4.000000 ... 5.000000 3.000000 3.000000 2.000000 3.000000 1.000000 1.000000 1.000000 1.000000 1.000000
25% 21.000000 62.000000 67.000000 1.000000 3.000000 2.000000 8.000000 38.000000 30.000000 44.000000 ... 39.000000 51.000000 30.000000 27.000000 24.000000 8.000000 8.000000 8.000000 8.000000 8.000000
50% 25.000000 66.000000 71.000000 1.000000 3.000000 2.000000 17.000000 54.000000 49.000000 56.000000 ... 49.000000 60.000000 53.000000 55.000000 52.000000 11.000000 11.000000 11.000000 11.000000 11.000000
75% 28.000000 71.000000 75.000000 1.000000 3.000000 3.000000 26.000000 64.000000 62.000000 64.000000 ... 60.000000 67.000000 64.000000 66.000000 64.000000 14.000000 14.000000 14.000000 14.000000 14.000000
max 45.000000 94.000000 95.000000 5.000000 5.000000 5.000000 99.000000 93.000000 95.000000 94.000000 ... 92.000000 96.000000 94.000000 93.000000 91.000000 90.000000 92.000000 91.000000 90.000000 94.000000

8 rows × 41 columns

ELEMENTS IN DATASETS

In [8]:
df_fifa.nunique()
Out[8]:
Name                        17194
Age                            29
Nationality                   164
Overall                        48
Potential                      47
Club                          651
Value                         217
Wage                          144
Preferred Foot                  2
International Reputation        5
Weak Foot                       5
Skill Moves                     5
Work Rate                       9
Position                       27
Jersey Number                  99
Height                         21
Crossing                       89
Finishing                      93
HeadingAccuracy                91
ShortPassing                   85
Volleys                        87
Dribbling                      94
Curve                          89
FKAccuracy                     90
LongPassing                    84
BallControl                    90
Acceleration                   86
SprintSpeed                    85
Agility                        81
Reactions                      68
Balance                        81
ShotPower                      92
Jumping                        74
Stamina                        85
Strength                       74
LongShots                      92
Aggression                     85
Interceptions                  89
Positioning                    94
Vision                         85
Penalties                      87
Composure                      84
Marking                        92
StandingTackle                 90
SlidingTackle                  88
GKDiving                       71
GKHandling                     70
GKKicking                      79
GKPositioning                  79
GKReflexes                     76
dtype: int64

EXPLORATORY DATA ANALYSIS

HIGHEST RATED PLAYERS IN FIFA19

In [9]:
df_fifa.sort_values(by = "Overall", ascending = False)[["Name", "Position", "Nationality", "Club", "Age", "Overall"]].head()
Out[9]:
Name Position Nationality Club Age Overall
0 L. Messi RF Argentina FC Barcelona 31 94
1 Cristiano Ronaldo ST Portugal Juventus 33 94
2 Neymar Jr LW Brazil Paris Saint-Germain 26 92
3 De Gea GK Spain Manchester United 27 91
4 K. De Bruyne RCM Belgium Manchester City 27 91

LOWEST RATED PLAYERS IN FIFA19

In [10]:
df_fifa.sort_values(by = "Overall", ascending = True)[["Name", "Position", "Nationality", "Club", "Age", "Overall"]].head()
Out[10]:
Name Position Nationality Club Age Overall
18206 G. Nugent CM England Tranmere Rovers 16 46
18186 Zhang Yufeng CM China PR Beijing Renhe FC 20 47
18187 C. Ehlich RB Germany SpVgg Unterhaching 19 47
18188 L. Collins CM Wales Newport County 17 47
18189 A. Kaltner ST Germany SpVgg Unterhaching 18 47

PLAYERS WITH BEST POTENTIAL

In [11]:
df_fifa.sort_values(by = "Potential", ascending = False)[["Name", "Position", "Potential", "Club", "Age", "Overall"]].head()
Out[11]:
Name Position Potential Club Age Overall
25 K. Mbappé RM 95 Paris Saint-Germain 19 88
0 L. Messi RF 94 FC Barcelona 31 94
15 P. Dybala LF 94 Juventus 24 89
1 Cristiano Ronaldo ST 94 Juventus 33 94
2 Neymar Jr LW 93 Paris Saint-Germain 26 92

OLDEST PLAYERS

In [12]:
df_fifa.sort_values(by = "Age", ascending = False)[["Name", "Position", "Potential", "Club", "Age", "Overall"]].head()
Out[12]:
Name Position Potential Club Age Overall
4741 O. Pérez GK 71 Pachuca 45 71
18183 K. Pilkington GK 48 Cambridge United 44 48
17726 T. Warner GK 53 Accrington Stanley 44 53
10545 S. Narazaki GK 65 Nagoya Grampus 42 65
7225 C. Muñoz GK 68 CD Universidad de Concepción 41 68

YOUNGEST PLAYERS

In [13]:
df_fifa.sort_values(by = "Age", ascending = True)[["Name", "Position", "Potential", "Club", "Age", "Overall"]].head()
Out[13]:
Name Position Potential Club Age Overall
18206 G. Nugent CM 66 Tranmere Rovers 16 46
17743 J. Olstad ST 69 Sarpsborg 08 FF 16 52
13293 H. Massengo CDM 75 AS Monaco 16 62
16081 J. Italiano LM 79 Perth Glory 16 58
18166 N. Ayéva ST 72 Örebro SK 16 48

PLAYERS WITH BEST SHOTPOWER

In [14]:
df_fifa.sort_values(by = "ShotPower", ascending = False)[["Name", "Club", "Position", "ShotPower", "Overall"]].head()
Out[14]:
Name Club Position ShotPower Overall
1 Cristiano Ronaldo Juventus ST 95.0 94
378 Hulk Shanghai SIPG FC RCM 94.0 81
1348 F. Guarín Shanghai Greenland Shenhua FC LDM 93.0 76
890 L. Podolski Vissel Kobe RF 92.0 78
36 G. Bale Real Madrid ST 92.0 88

BEST DRIBBLERS IN THE GAME

In [15]:
df_fifa.sort_values(by = "Dribbling", ascending = False)[["Name", "Club", "Position", "Dribbling", "Overall"]].head()
Out[15]:
Name Club Position Dribbling Overall
0 L. Messi FC Barcelona RF 97.0 94
2 Neymar Jr Paris Saint-Germain LW 96.0 92
5 E. Hazard Chelsea LF 95.0 91
30 Isco Real Madrid LW 94.0 88
94 Y. Brahimi FC Porto LM 93.0 85

BEST CROSSERS OF THE BALL

In [16]:
df_fifa.sort_values(by = "Crossing", ascending = False)[["Name", "Club", "Position", "Crossing", "Overall"]].head()
Out[16]:
Name Club Position Crossing Overall
4 K. De Bruyne Manchester City RCM 93.0 91
153 Quaresma Beşiktaş JK RM 92.0 84
390 Pedro León SD Eibar RM 91.0 81
290 K. Trippier Tottenham Hotspur RB 91.0 82
291 A. Kolarov Roma LB 91.0 82

BEST FREEKICK TAKERS

In [17]:
df_fifa.sort_values(by = "FKAccuracy", ascending = False)[["Name", "Club", "Position", "FKAccuracy", "Overall"]].head()
Out[17]:
Name Club Position FKAccuracy Overall
0 L. Messi FC Barcelona RF 94.0 94
293 S. Giovinco Toronto FC CF 93.0 82
72 M. Pjanić Juventus CDM 92.0 86
1113 E. Bardhi Levante UD LCM 91.0 77
449 H. Çalhanoğlu Milan CAM 90.0 80

PLAYERS HAVING BEST BALL CONTROL

In [18]:
df_fifa.sort_values(by = "BallControl", ascending = False)[["Name", "Club", "Position", "BallControl", "Overall"]].head()
Out[18]:
Name Club Position BallControl Overall
0 L. Messi FC Barcelona RF 96.0 94
2 Neymar Jr Paris Saint-Germain LW 95.0 92
30 Isco Real Madrid LW 95.0 88
5 E. Hazard Chelsea LF 94.0 91
1 Cristiano Ronaldo Juventus ST 94.0 94

PLAYERS WITH BEST VISION

In [19]:
df_fifa.sort_values(by = "Vision" , ascending = False)[["Name", "Club" ,"Nationality" ,"Vision", "Overall" ]].head()
Out[19]:
Name Club Nationality Vision Overall
0 L. Messi FC Barcelona Argentina 94.0 94
4 K. De Bruyne Manchester City Belgium 94.0 91
76 Iniesta Vissel Kobe Spain 93.0 86
13 David Silva Manchester City Spain 92.0 90
6 L. Modrić Real Madrid Croatia 92.0 91

BEST FINISHERS

In [20]:
df_fifa.sort_values(by = "Finishing", ascending = False)[["Name", "Club", "Position", "Finishing", "Overall"]].head()
Out[20]:
Name Club Position Finishing Overall
0 L. Messi FC Barcelona RF 95.0 94
1 Cristiano Ronaldo Juventus ST 94.0 94
16 H. Kane Tottenham Hotspur ST 94.0 89
23 S. Agüero Manchester City ST 93.0 89
7 L. Suárez FC Barcelona RS 93.0 91

PLAYERS WITH FAST ACCELERATION

In [21]:
df_fifa.sort_values(by = "Acceleration", ascending = False)[["Name", "Club", "Position", "Acceleration", "Overall"]].head()
Out[21]:
Name Club Position Acceleration Overall
1968 Adama Wolverhampton Wanderers RW 97.0 75
65 Douglas Costa Juventus LM 97.0 86
5886 K. Manneh FC St. Gallen LM 96.0 69
25 K. Mbappé Paris Saint-Germain RM 96.0 88
2587 J. Biabiany Parma RW 95.0 74

BEST SPRINTERS

In [22]:
df_fifa.sort_values(by = "SprintSpeed", ascending = False)[["Name", "Club", "Position", "SprintSpeed", "Overall"]].head()
Out[22]:
Name Club Position SprintSpeed Overall
1968 Adama Wolverhampton Wanderers RW 96.0 75
55 L. Sané Manchester City LW 96.0 86
25 K. Mbappé Paris Saint-Germain RM 96.0 88
1489 I. Bebou Hannover 96 RM 95.0 76
36 G. Bale Real Madrid ST 95.0 88

BEST LONG PASSERS IN THE GAME

In [23]:
df_fifa.sort_values(by = "LongPassing", ascending = False)[["Name", "Club", "Position", "LongPassing", "Overall"]].head()
Out[23]:
Name Club Position LongPassing Overall
11 T. Kroos Real Madrid LCM 93.0 90
4 K. De Bruyne Manchester City RCM 91.0 91
45 P. Pogba Manchester United RDM 90.0 87
53 I. Rakitić FC Barcelona RCM 90.0 87
219 Cesc Fàbregas Chelsea CM 89.0 83

STRONGEST PLAYERS

In [24]:
df_fifa.sort_values(by = "Strength", ascending = False)[["Name", "Club", "Position", "Strength", "Overall"]].head()
Out[24]:
Name Club Position Strength Overall
9501 A. Akinfenwa Wycombe Wanderers LS 97.0 66
1124 Wesley Club Brugge KV LS 95.0 77
2559 K. Waston Vancouver Whitecaps FC RCB 95.0 74
14111 T. Chorý Viktoria Plzeň ST 95.0 61
15179 M. Rhead Lincoln City ST 94.0 60

MOST AGGRESIVE PLAYERS

In [25]:
df_fifa.sort_values(by = "Aggression", ascending = False)[["Name", "Club", "Position", "Aggression", "Overall"]].head()
Out[25]:
Name Club Position Aggression Overall
1948 B. Pearson Preston North End RDM 95.0 75
9512 D. Erdmann 1. FC Magdeburg CB 94.0 66
940 Gazzolisco Internacional LB 94.0 77
16919 D. Pipe Newport County RWB 94.0 56
4037 J. Garner Wigan Athletic ST 94.0 71

BEST GOAL KEEPERS (REFLEXES)

In [26]:
df_fifa.sort_values(by = "GKReflexes", ascending = False)[["Name", "Club", "Position", "GKReflexes", "Overall"]].head()
Out[26]:
Name Club Position GKReflexes Overall
3 De Gea Manchester United GK 94.0 91
37 H. Lloris Tottenham Hotspur GK 92.0 88
18 M. ter Stegen FC Barcelona GK 90.0 89
128 M. Perin Juventus GK 90.0 84
46 K. Navas Real Madrid GK 90.0 87

BEST GOAL KEEPERS (DIVING)

In [27]:
df_fifa.sort_values(by = "GKDiving", ascending = False)[["Name", "Club", "Position", "GKDiving", "Overall"]].head()
Out[27]:
Name Club Position GKDiving Overall
22 M. Neuer FC Bayern München GK 90.0 89
46 K. Navas Real Madrid GK 90.0 87
3 De Gea Manchester United GK 90.0 91
37 H. Lloris Tottenham Hotspur GK 88.0 88
41 G. Buffon Paris Saint-Germain GK 88.0 88

BEST DEFENDERS (SLIDING TACKLE)

In [28]:
df_fifa.sort_values(by = "SlidingTackle", ascending = False)[["Name", "Club", "Nationality", "SlidingTackle", "Overall"]].head()
Out[28]:
Name Club Nationality SlidingTackle Overall
8 Sergio Ramos Real Madrid Spain 91.0 91
101 R. Nainggolan Inter Belgium 90.0 85
24 G. Chiellini Juventus Italy 90.0 89
88 K. Manolas Roma Greece 89.0 85
12 D. Godín Atlético Madrid Uruguay 89.0 90

BEST DEFENDERS (STANDING TACKLE)

In [29]:
df_fifa.sort_values(by = "StandingTackle", ascending = False)[["Name", "Club", "Nationality", "StandingTackle", "Overall"]].head()
Out[29]:
Name Club Nationality StandingTackle Overall
24 G. Chiellini Juventus Italy 93.0 89
8 Sergio Ramos Real Madrid Spain 92.0 91
71 T. Alderweireld Tottenham Hotspur Belgium 91.0 86
14 N. Kanté Chelsea France 91.0 89
27 Casemiro Real Madrid Brazil 90.0 88

NUMBER OF PLAYERS AT CERTAIN POSITIONS

In [30]:
plt.figure(1, figsize = (15, 6))
pos = sns.countplot(x = "Position", data = df_fifa, palette = "hls");
pos.set_title(label="Number of players at specialized position", fontsize=40);
plt.show()

BEST LEFT FOOTED PLAYERS

In [31]:
df_fifa[df_fifa["Preferred Foot"] == "Left"][["Name", "Club", "Position","Overall"]].head()
Out[31]:
Name Club Position Overall
0 L. Messi FC Barcelona RF 94
13 David Silva Manchester City LCM 90
15 P. Dybala Juventus LF 89
17 A. Griezmann Atlético Madrid CAM 89
19 T. Courtois Real Madrid GK 89

BEST RIGHT FOOTED PLAYERS

In [32]:
df_fifa[df_fifa["Preferred Foot"] == "Right"][["Name","Club", "Position", "Overall"]].head()
Out[32]:
Name Club Position Overall
1 Cristiano Ronaldo Juventus ST 94
2 Neymar Jr Paris Saint-Germain LW 92
3 De Gea Manchester United GK 91
4 K. De Bruyne Manchester City RCM 91
5 E. Hazard Chelsea LF 91

COMPARISON : LEFT FOOT VS RIGHT FOOT IN TERMS OF DRIBBLING AND FINISHING

In [33]:
sns.lmplot(x = "Finishing", y = "Dribbling", data = df_fifa, scatter_kws = {"alpha":0.1}, col = "Preferred Foot");
plt.show()

ATTRIBUTES : PLAYER NAME

In [34]:
cols = ["Crossing", "Potential", "Finishing", "HeadingAccuracy", "ShortPassing", "Volleys", 
        "Dribbling", "Curve", "FKAccuracy", "LongPassing", "BallControl", "Acceleration", 
        "SprintSpeed", "Agility", "Reactions", "Balance", "ShotPower", "Jumping", "Stamina", 
        "Strength", "LongShots", "Aggression", "Interceptions", "Positioning", "Vision", 
        "Penalties", "Composure", "Marking", "StandingTackle", "SlidingTackle", "GKDiving", 
        "GKHandling", "GKKicking", "GKPositioning", "GKReflexes"]
i=0
while i < len(cols):
    print('Best {0} : {1}'.format(cols[i], df_fifa.loc[df_fifa[cols[i]].idxmax()]["Name"]))
    i += 1
Best Crossing : K. De Bruyne
Best Potential : K. Mbappé
Best Finishing : L. Messi
Best HeadingAccuracy : Naldo
Best ShortPassing : L. Modrić
Best Volleys : E. Cavani
Best Dribbling : L. Messi
Best Curve : Quaresma
Best FKAccuracy : L. Messi
Best LongPassing : T. Kroos
Best BallControl : L. Messi
Best Acceleration : Douglas Costa
Best SprintSpeed : K. Mbappé
Best Agility : Neymar Jr
Best Reactions : Cristiano Ronaldo
Best Balance : Bernard
Best ShotPower : Cristiano Ronaldo
Best Jumping : Cristiano Ronaldo
Best Stamina : N. Kanté
Best Strength : A. Akinfenwa
Best LongShots : L. Messi
Best Aggression : B. Pearson
Best Interceptions : N. Kanté
Best Positioning : Cristiano Ronaldo
Best Vision : L. Messi
Best Penalties : M. Balotelli
Best Composure : L. Messi
Best Marking : A. Barzagli
Best StandingTackle : G. Chiellini
Best SlidingTackle : Sergio Ramos
Best GKDiving : De Gea
Best GKHandling : J. Oblak
Best GKKicking : M. Neuer
Best GKPositioning : G. Buffon
Best GKReflexes : De Gea

BEST PLAYER AT EACH POSITION

In [35]:
display(HTML(df_fifa.iloc[df_fifa.groupby(df_fifa["Position"])["Overall"].idxmax()][["Name", "Position"]].to_html(index=False)))
Name Position
A. Griezmann CAM
D. Godín CB
Sergio Busquets CDM
Luis Alberto CF
Thiago CM
De Gea GK
J. Rodríguez LAM
Marcelo LB
G. Chiellini LCB
T. Kroos LCM
N. Kanté LDM
E. Hazard LF
P. Aubameyang LM
E. Cavani LS
Neymar Jr LW
N. Schulz LWB
J. Cuadrado RAM
Azpilicueta RB
Sergio Ramos RCB
K. De Bruyne RCM
P. Pogba RDM
L. Messi RF
K. Mbappé RM
L. Suárez RS
Bernardo Silva RW
M. Ginter RWB
Cristiano Ronaldo ST

TOP 3 FEATURES FOR EACH POSITION

In [36]:
player_features = ["Crossing", "Potential", "Finishing", "HeadingAccuracy", "ShortPassing", "Volleys", 
        "Dribbling", "Curve", "FKAccuracy", "LongPassing", "BallControl", "Acceleration", 
        "SprintSpeed", "Agility", "Reactions", "Balance", "ShotPower", "Jumping", "Stamina", 
        "Strength", "LongShots", "Aggression", "Interceptions", "Positioning", "Vision", 
        "Penalties", "Composure", "Marking", "StandingTackle", "SlidingTackle", "GKDiving", 
        "GKHandling", "GKKicking", "GKPositioning", "GKReflexes"]

for i, val in df_fifa.groupby(df_fifa["Position"])[player_features].mean().iterrows():
    print("Position {}: {}, {}, {}".format(i, *tuple(val.nlargest(3).index)))
Position CAM: Balance, Potential, Agility
Position CB: Strength, Potential, Jumping
Position CDM: Potential, Stamina, Aggression
Position CF: Agility, Balance, Acceleration
Position CM: Potential, Balance, ShortPassing
Position GK: Potential, GKReflexes, GKDiving
Position LAM: Agility, Balance, SprintSpeed
Position LB: SprintSpeed, Acceleration, Stamina
Position LCB: Strength, Potential, Jumping
Position LCM: Stamina, Potential, ShortPassing
Position LDM: Stamina, Potential, ShortPassing
Position LF: Balance, Agility, Acceleration
Position LM: Acceleration, SprintSpeed, Agility
Position LS: SprintSpeed, Potential, Strength
Position LW: Acceleration, SprintSpeed, Agility
Position LWB: SprintSpeed, Acceleration, Stamina
Position RAM: Agility, Balance, Acceleration
Position RB: SprintSpeed, Stamina, Acceleration
Position RCB: Strength, Potential, Jumping
Position RCM: Stamina, Potential, ShortPassing
Position RDM: Stamina, Potential, ShortPassing
Position RF: Agility, Potential, Acceleration
Position RM: Acceleration, SprintSpeed, Agility
Position RS: SprintSpeed, Potential, Strength
Position RW: Acceleration, SprintSpeed, Agility
Position RWB: SprintSpeed, Acceleration, Stamina
Position ST: Potential, SprintSpeed, Strength

FREQUENCY OF OVERALL PLAYER RATINGS

In [37]:
plt.figure(1, figsize = (15, 6))
pos = sns.countplot(x = "Overall", data = df_fifa, palette = "hls");
pos.set_title(label="Player Ratings out of 100", fontsize=40);
plt.show()

PLAYER POTENTIAL DISTRIBUTION

In [38]:
plt.figure(1, figsize = (15, 6))
pos = sns.countplot(x = "Potential", data = df_fifa, palette = "hls");
pos.set_title(label="Player Potential Distribution", fontsize=40);
plt.show()

PLAYERS AGE DISTRIBUTION

In [39]:
plt.figure(1, figsize = (15, 6))
pos = sns.countplot(x = "Age", data = df_fifa, palette = "hls");
pos.set_title(label="Age Distribution", fontsize=40);
plt.show()

AGE DISTRIBUTION IN TOP CLUBS IN EUROPE

In [40]:
clubs = ["FC Barcelona", "Real Madrid", "Juventus", "Liverpool", "Manchester City", "Paris Saint-Germain"]
df_club_age = df_fifa.loc[df_fifa["Club"].isin(clubs) & df_fifa["Age"]]
plt.figure(1 , figsize = (15 ,7))
sns.violinplot(x = "Club", y = "Age", data = df_club_age)
plt.title("Age Distribution in Top European clubs")
plt.xticks(rotation = 50)
plt.show()

CLUBS WITH MOST PLAYERS

In [41]:
print("Total number of clubs : {0}".format(df_fifa["Club"].nunique()))
print(df_fifa["Club"].value_counts().head(10))
Total number of clubs : 651
Borussia Dortmund          33
Cardiff City               33
Real Madrid                33
Valencia CF                33
Everton                    33
Atlético Madrid            33
Fortuna Düsseldorf         33
CD Leganés                 33
Frosinone                  33
Wolverhampton Wanderers    33
Name: Club, dtype: int64

BEST SQUAD SIZE

In [42]:
plt.figure(1 , figsize = (15 , 5))
club = []
c = counter(df_fifa["Club"]).most_common()[:11]
for n in range(11):club.append(c[n][0])

sns.countplot(x = "Club", data = df_fifa[df_fifa["Club"].isin(club)], 
              order  = df_fifa[df_fifa["Club"].isin(club)]["Club"].value_counts().index, palette = "rocket") 
plt.xticks(rotation = 90)
plt.title("Clubs with best squad size" )
plt.show()

CHANGING DATA FORMAT

In [43]:
def cleaning_value(x):
    if '€' in str(x) and 'M' in str(x):
        c = str(x).replace('€' , '')
        c = str(c).replace('M' , '')
        c = float(c) * 1000000
        
    else:
        c = str(x).replace('€' , '')
        c = str(c).replace('K' , '')
        c = float(c) * 1000
            
    return c

fn = lambda x : cleaning_value(x)

df_fifa["Value_num"] = df_fifa["Value"].apply(fn)
df_fifa["Wage_num"] = df_fifa["Wage"].apply(fn)

MOST VALUABLE PLAYERS

In [44]:
df_fifa.sort_values(by = "Value_num", ascending = False)[["Name", "Club", "Nationality", "Overall", "Value"]].head()
Out[44]:
Name Club Nationality Overall Value
2 Neymar Jr Paris Saint-Germain Brazil 92 €118.5M
0 L. Messi FC Barcelona Argentina 94 €110.5M
4 K. De Bruyne Manchester City Belgium 91 €102M
5 E. Hazard Chelsea Belgium 91 €93M
15 P. Dybala Juventus Argentina 89 €89M

BEST PAID PLAYERS

In [45]:
df_fifa.sort_values(by = "Wage_num", ascending = False)[["Name", "Club", "Nationality", "Overall", "Wage"]].head()
Out[45]:
Name Club Nationality Overall Wage
0 L. Messi FC Barcelona Argentina 94 €565K
7 L. Suárez FC Barcelona Uruguay 91 €455K
6 L. Modrić Real Madrid Croatia 91 €420K
1 Cristiano Ronaldo Juventus Portugal 94 €405K
8 Sergio Ramos Real Madrid Spain 91 €380K

AGE DISTRIBUTION IN TOP COUNTRIES

In [46]:
country = ["Argentina", "Brazil", "France", "Belgium", "England", "Spain", "Portugal"]
df_country_age = df_fifa.loc[df_fifa["Nationality"].isin(country) & df_fifa["Age"]]
plt.figure(1 , figsize = (15 ,7))
sns.violinplot(x = "Nationality" , y = "Age" , data = df_country_age)
plt.title("Age Distribution in Top National Teams")
plt.xticks(rotation = 50)
plt.show()

AGE VS OVERALL RATING COMPARISON

In [47]:
plt.figure(1 , figsize = (15 , 6))
sns.boxplot(df_fifa["Age"], df_fifa["Overall"])
plt.title("Age vs Overall rating Comparison")
plt.show()

AGE VS STAMINA COMPARISON

In [48]:
plt.figure(1 , figsize = (15 , 9))
sns.boxplot(x = "Age", y = "Stamina", data = df_fifa)
plt.title("Age vs Stamina Comparison")
plt.show()

AGE VS SPRINT SPEED COMPARISON

In [49]:
plt.figure(1 , figsize = (15 , 9))
sns.boxplot(x = "Age", y = "SprintSpeed", data = df_fifa)
plt.title("Age vs Sprint Speed Comparison")
plt.show()

AGE VS REACTION COMPARISON

In [50]:
plt.figure(1 , figsize = (15 , 9))
sns.boxplot(x = "Age", y = "Reactions", data = df_fifa)
plt.title("Age vs Reactions Comparison")
plt.show()

DRIBBLING VS FINISHING COMPARISON

In [51]:
plt.figure(1 , figsize = (25 , 9))
sns.boxplot(x = "Dribbling", y = "Finishing", data = df_fifa)
plt.title("Dribbling vs Finishing Comparison")
plt.show()

AGE VS FINISHING COMPARISON

In [52]:
plt.figure(1 , figsize = (15 , 9))
sns.boxplot(x = "Age", y = "Finishing", data = df_fifa)
plt.title("Age vs Finishing Comparison")
plt.show()

COMPARING FEATURES WITH RESPECT TO ACCELERATION

In [53]:
def make_scatter(df_fifa):
    feats = ("Agility", "Balance", "Dribbling", "SprintSpeed")
    
    for index, feat in enumerate(feats):
        plt.subplot(len(feats)/4+1, 4, index+1)
        ax = sns.regplot(x = 'Acceleration', y = feat, data = df_fifa)

plt.figure(figsize = (20, 20))
plt.subplots_adjust(hspace = 0.4)

make_scatter(df_fifa)
plt.show()

COUNTRY WITH MOST PLAYERS

In [54]:
print("Total number of countries : {0}".format(df_fifa["Nationality"].nunique()))
print(df_fifa["Nationality"].value_counts().head(10))
Total number of countries : 164
England        1662
Germany        1198
Spain          1072
Argentina       937
France          914
Brazil          827
Italy           702
Colombia        618
Japan           478
Netherlands     453
Name: Nationality, dtype: int64

COUNTPLOT DISTRIBUTION

In [55]:
plt.figure(1, figsize = (20 , 7))
countries = []
c = counter(df_fifa["Nationality"]).most_common()[:11]
for n in range(11) : countries.append(c[n][0])
sns.countplot(x  = "Nationality", data = df_fifa[df_fifa["Nationality"].isin(countries)],
              order  = df_fifa[df_fifa["Nationality"].isin(countries)]["Nationality"].value_counts().index, 
              palette = "rocket") 
plt.xticks(rotation = 90)
plt.title("Most Players Belong To" )
plt.show()

PIE CHART DISTRIBUTION

In [56]:
countries=df_fifa["Nationality"].value_counts()
index=countries.index
con=pd.DataFrame({"Country":index,"Count":countries})
con=con["England":"Netherlands"]
plt.pie(con["Count"],labels=con["Country"],wedgeprops = {"linewidth": 5},autopct='%1.2f%%')
plt.title("Distribution of players in top 10 countries")
plt.tight_layout()
plt.show()

COMPARISON - FC BARCELONA, REAL MADRID, LIVERPOOL AND MANCHESTER CITY

FC BARCELONA

In [57]:
plt.figure(1, figsize = (15, 10))
img = mpimg.imread("Barcelonalogo.jpg") 
plt.imshow(img)
plt.show()

FULL SQUAD LIST OF FC BARCELONA

In [58]:
df_fifa[df_fifa["Club"] == "FC Barcelona"][["Name", "Position", "Overall", "Age", "Wage", "Nationality"]]
Out[58]:
Name Position Overall Age Wage Nationality
0 L. Messi RF 94 31 €565K Argentina
7 L. Suárez RS 91 31 €455K Uruguay
18 M. ter Stegen GK 89 26 €240K Germany
20 Sergio Busquets CDM 89 29 €315K Spain
32 Coutinho LW 88 26 €340K Brazil
42 S. Umtiti CB 87 24 €205K France
49 Jordi Alba LB 87 29 €250K Spain
53 I. Rakitić RCM 87 30 €260K Croatia
54 Piqué RCB 87 31 €240K Spain
96 A. Vidal CAM 85 31 €205K Chile
155 O. Dembélé RW 83 21 €155K France
192 Sergi Roberto RB 83 26 €170K Spain
228 Arthur LCM 82 21 €125K Brazil
236 Malcom RW 82 21 €140K Brazil
239 C. Lenglet LCB 82 23 €135K France
263 Rafinha CAM 82 25 €165K Brazil
266 J. Cillessen GK 82 29 €135K Netherlands
324 Nélson Semedo RB 81 24 €125K Portugal
613 Denis Suárez CM 79 24 €120K Spain
1007 Munir ST 77 22 €115K Spain
1037 T. Vermaelen CB 77 32 €110K Belgium
3118 Sergi Samper CDM 73 23 €69K Spain
3684 Aleñá CM 72 20 €58K Spain
6000 M. Wagué RB 69 19 €20K Senegal
6102 Riqui Puig CM 69 18 €24K Spain
8284 Oriol Busquets CDM 67 19 €14K Spain
8289 Abel Ruiz ST 67 18 €21K Spain
8857 Miranda LB 66 18 €12K Spain
10526 Chumi CB 65 19 €11K Spain
10777 Jorge Cuenca CB 65 18 €11K Spain
11300 Guillem Jaime RW 64 19 €13K Spain
12502 Ezkieta GK 63 21 €10K Spain
14286 Iñaki Peña GK 61 19 €4K Spain

THE BEST PLAYER OF FC BARCELONA

LIONEL MESSI HAS BEEN RANKED AT THE TOP OF FIFA19 RATINGS

HE IS ALSO THE BEST PLAYER OF FC BARCELONA

In [59]:
plt.figure(1, figsize = (15, 10))
img = mpimg.imread("Messi.jpg") 
plt.imshow(img)
plt.show()

REAL MADRID

In [60]:
plt.figure(1, figsize = (15, 20))
img = mpimg.imread("rmlogo.png") 
plt.imshow(img)
plt.show()

FULL SQUAD LIST OF REAL MADRID

In [61]:
df_fifa[df_fifa["Club"] == "Real Madrid"][["Name", "Position", "Overall", "Age", "Wage", "Nationality"]]
Out[61]:
Name Position Overall Age Wage Nationality
6 L. Modrić RCM 91 32 €420K Croatia
8 Sergio Ramos RCB 91 32 €380K Spain
11 T. Kroos LCM 90 28 €355K Germany
19 T. Courtois GK 89 26 €240K Belgium
27 Casemiro CDM 88 26 €285K Brazil
30 Isco LW 88 26 €315K Spain
35 Marcelo LB 88 30 €285K Brazil
36 G. Bale ST 88 28 €355K Wales
46 K. Navas GK 87 31 €195K Costa Rica
62 R. Varane RCB 86 25 €210K France
79 Marco Asensio RW 85 22 €215K Spain
105 K. Benzema ST 85 30 €240K France
123 Carvajal RB 84 26 €185K Spain
172 Lucas Vázquez RW 83 27 €205K Spain
188 Nacho Fernández CB 83 28 €180K Spain
328 Dani Ceballos LCM 81 21 €120K Spain
417 Odriozola RB 80 22 €115K Spain
430 Mariano ST 80 24 €140K Dominican Republic
573 Marcos Llorente CDM 79 23 €110K Spain
697 Kiko Casilla GK 79 31 €105K Spain
754 Vallejo CB 78 21 €81K Spain
1143 Vinícius Júnior LW 77 17 €66K Brazil
2513 F. Valverde CM 74 19 €46K Uruguay
6724 Reguilón LB 68 21 €28K Spain
8732 Javi Sánchez CB 67 21 €24K Spain
9141 Cristo González ST 66 20 €26K Spain
10178 F. Feuillassier LW 65 20 €23K Argentina
10269 Fidalgo CM 65 21 €20K Spain
11163 Sergio López RB 64 19 €9K Spain
11327 Fran García LB 64 18 €9K Spain
11877 Manu Hernando CB 64 19 €9K Spain
12504 Dani Gómez ST 63 19 €12K Spain
13687 L. Zidane GK 62 20 €9K France

BEST PLAYER OF REAL MADRID

LUKA MODRIC IS THE HIGHEST RATED REAL MADRID PLAYER IN FIFA19

In [62]:
plt.figure(1, figsize = (15, 20))
img = mpimg.imread("modric.jpg") 
plt.imshow(img)
plt.show()

LIVERPOOL FOOTBALL CLUB

In [63]:
plt.figure(1, figsize = (15, 20))
img = mpimg.imread("liverpoollogo.jpg") 
plt.imshow(img)
plt.show()

FULL SQUAD LIST OF LIVERPOOL

In [64]:
df_fifa[df_fifa["Club"] == "Liverpool"][["Name", "Position", "Overall", "Age", "Wage", "Nationality"]]
Out[64]:
Name Position Overall Age Wage Nationality
26 M. Salah RM 88 26 €255K Egypt
58 S. Mané LM 86 26 €195K Senegal
59 V. van Dijk LCB 86 26 €165K Netherlands
61 Roberto Firmino CAM 86 26 €195K Brazil
81 Alisson GK 85 25 €115K Brazil
118 Fabinho CDM 84 24 €120K Brazil
161 N. Keïta CM 83 23 €120K Guinea
241 A. Robertson LB 82 24 €98K Scotland
296 J. Henderson RCM 82 28 €125K England
302 G. Wijnaldum CAM 82 27 €130K Netherlands
368 D. Lovren RCB 81 28 €115K Croatia
370 X. Shaqiri CAM 81 26 €130K Switzerland
409 J. Milner CM 81 32 €120K England
481 A. Oxlade-Chamberlain CM 80 24 €94K England
483 J. Matip CB 80 26 €99K Cameroon
515 A. Lallana CM 80 30 €110K England
529 D. Sturridge ST 80 28 €125K England
665 N. Clyne RB 79 27 €94K England
703 S. Mignolet GK 79 30 €76K Belgium
735 T. Alexander-Arnold RB 78 19 €36K England
755 J. Gomez CB 78 21 €61K England
1063 D. Origi ST 77 23 €83K Belgium
1194 Alberto Moreno LB 77 25 €76K Spain
2405 L. Marković RM 74 24 €62K Serbia
4763 D. Solanke ST 70 20 €37K England
8853 Pedro Chirivella CM 66 21 €17K Spain
13503 R. Brewster ST 62 18 €8K England
13961 C. Jones CM 61 17 €7K England
14036 N. Phillips CB 61 21 €9K England
14252 Rafael Camacho CAM 61 18 €7K Portugal
14674 B. Adekanye RW 60 19 €7K Netherlands
15378 K. Grabara GK 59 19 €3K Poland
15627 M. Virtue CDM 59 21 €8K England

BEST PLAYER OF LIVERPOOL

M. SALAH IS HIGHEST RATED LIVERPOOL PLAYER IN FIFA19

In [65]:
plt.figure(1, figsize = (15, 20))
img = mpimg.imread("salah.jpg") 
plt.imshow(img)
plt.show()

MANCHESTER CITY

In [66]:
plt.figure(1, figsize = (15, 20))
img = mpimg.imread("mancitylogo.jpg") 
plt.imshow(img)
plt.show()

FULL SQUAD LIST OF MANCHESTER CITY

In [67]:
df_fifa[df_fifa["Club"] == "Manchester City"][["Name", "Position", "Overall", "Age", "Wage", "Nationality"]]
Out[67]:
Name Position Overall Age Wage Nationality
4 K. De Bruyne RCM 91 27 €355K Belgium
13 David Silva LCM 90 32 €285K Spain
23 S. Agüero ST 89 30 €300K Argentina
55 L. Sané LW 86 22 €195K Germany
56 Bernardo Silva RW 86 23 €180K Portugal
57 Ederson GK 86 24 €125K Brazil
60 R. Sterling RW 86 23 €195K England
75 Fernandinho CDM 86 33 €185K Brazil
84 R. Mahrez RW 85 27 €205K Algeria
89 N. Otamendi CB 85 30 €170K Argentina
107 V. Kompany CB 85 32 €170K Belgium
113 A. Laporte LCB 84 24 €135K France
135 K. Walker RB 84 28 €165K England
136 I. Gündoğan CM 84 27 €175K Germany
156 Gabriel Jesus ST 83 21 €130K Brazil
182 J. Stones RCB 83 24 €125K England
352 B. Mendy LB 81 23 €105K France
514 F. Delph LB 80 28 €120K England
645 Danilo RB 79 26 €110K Brazil
871 C. Bravo GK 78 35 €50K Chile
1304 E. Mangala CB 76 27 €84K France
2903 P. Foden CAM 73 18 €36K England
4652 O. Zinchenko LB 71 21 €38K Ukraine
6316 P. Sandler CB 69 21 €28K Netherlands
6559 Brahim Díaz LW 69 18 €24K Spain
8966 C. Gomes CDM 66 17 €10K France
13211 Eric García CB 62 17 €6K Spain
13814 C. Humphreys-Grant CB 62 19 €6K England
14197 L. Bolton RM 61 18 €7K England
14511 A. Muric GK 61 19 €3K Montenegro
15210 B. Garré LW 60 17 €7K Argentina
16403 T. Dele-Bashiru CM 57 18 €6K England
17451 D. Grimshaw GK 54 20 €6K England

BEST PLAYER OF MANCHESTER CITY

KEVIN DE BRUYNE IS THE HIGHEST RATED MANCHESTER CITY PLAYER IN FIFA19

In [68]:
plt.figure(1, figsize = (15, 20))
img = mpimg.imread("kevin.jpg") 
plt.imshow(img)
plt.show()

DEFINING NEW VARIABLE NAME FOR THE CLUBS

In [69]:
barca = df_fifa[df_fifa["Club"] == "FC Barcelona"]
madrid = df_fifa[df_fifa["Club"] == "Real Madrid"]
liverpool = df_fifa[df_fifa["Club"] == "Liverpool"]
mancity = df_fifa[df_fifa["Club"] == "Manchester City"]

NUMBER OF FC BARCELONA PLAYERS AVAILABLE FOR EACH POSITION

In [70]:
barca["Position"].value_counts()
Out[70]:
CB     4
GK     4
CDM    3
CM     3
RW     3
RB     3
LB     2
ST     2
CAM    2
RCB    1
LCM    1
RCM    1
LCB    1
RF     1
RS     1
LW     1
Name: Position, dtype: int64

NUMBER OF REAL MADRID PLAYERS AVAILABLE FOR EACH POSITION

In [71]:
madrid["Position"].value_counts()
Out[71]:
ST     5
GK     4
CB     4
LW     3
LB     3
RB     3
CM     2
RCB    2
RW     2
CDM    2
LCM    2
RCM    1
Name: Position, dtype: int64

NUMBER OF LIVERPOOL PLAYERS AVAILABLE FOR EACH POSITION

In [72]:
liverpool["Position"].value_counts()
Out[72]:
CM     6
ST     4
CAM    4
CB     3
GK     3
LB     2
CDM    2
RM     2
RB     2
RCB    1
LCB    1
RCM    1
RW     1
LM     1
Name: Position, dtype: int64

NUMBER OF MANCHESTER CITY PLAYERS AVAILABLE FOR EACH POSITION

In [73]:
mancity["Position"].value_counts()
Out[73]:
CB     6
GK     4
LB     3
RW     3
LW     3
CM     2
CDM    2
ST     2
RB     2
RM     1
RCB    1
LCB    1
LCM    1
RCM    1
CAM    1
Name: Position, dtype: int64

DISTPLOT : AGE OF PLAYERS

In [74]:
plt.figure(1, figsize = (15, 6))
sns.distplot(barca["Age"], color = "blue")
sns.distplot(madrid["Age"], color = "black")
sns.distplot(liverpool["Age"], color = "red")
sns.distplot(mancity["Age"], color = "white")
plt.title("Comparison of distribution of Age between Top Club players")
plt.tight_layout()
plt.show()

DISTPLOT : PLAYER RATING

In [75]:
plt.figure(1, figsize = (15, 6))
sns.distplot(barca["Overall"], color = "blue")
sns.distplot(madrid["Overall"], color = "black")
sns.distplot(liverpool["Overall"], color = "red")
sns.distplot(mancity["Overall"], color = "white")
plt.title("Comparison of distribution of Player Ratings between Top Club players")
plt.tight_layout()
plt.show()

COMPARING PLAYER VALUE DISTRIBUTION AMONG CLUBS

In [76]:
plt.figure(1, figsize = (15, 6))
sns.distplot(barca["Value_num"], color = "blue")
sns.distplot(madrid["Value_num"], color = "black")
sns.distplot(liverpool["Value_num"], color = "red")
sns.distplot(mancity["Value_num"], color = "white")
plt.title("Comparison of Player Value between in Top Clubs")
plt.tight_layout()
plt.show()

COMPARING PLAYER WAGE DISTRIBUTION

In [77]:
plt.figure(1, figsize = (15, 6))
sns.distplot(barca["Wage_num"], color = "blue")
sns.distplot(madrid["Wage_num"], color = "black")
sns.distplot(liverpool["Wage_num"], color = "red")
sns.distplot(mancity["Wage_num"], color = "white")
plt.title("Comparison of Player Wages between Top Club")
plt.tight_layout()
plt.show()

COMPARING PLAYER POTENTIAL

In [78]:
plt.figure(1, figsize = (15, 6))
sns.distplot(barca["Potential"], color = "blue")
sns.distplot(madrid["Potential"], color = "black")
sns.distplot(liverpool["Potential"], color = "red")
sns.distplot(mancity["Potential"], color = "white")
plt.title("Distribution of Player Potential between Top Club")
plt.tight_layout()
plt.show()

COMPARING PLAYERS FINISHING

BETTER FINISHING LEADS TO MORE GOALS SCORED

In [79]:
plt.figure(1, figsize = (15, 6))
sns.distplot(barca["Finishing"], color = "blue")
sns.distplot(madrid["Finishing"], color = "black")
sns.distplot(liverpool["Finishing"], color = "red")
sns.distplot(mancity["Finishing"], color = "white")
plt.title("Distribution of Players Finishing capabilities between Top Club")
plt.tight_layout()
plt.show()

COUNTPLOT : PLAYER DISTRIBUTION WITH RESPECT TO COUNTRY

In [80]:
plt.figure(1, figsize = (15, 6))

plt.subplot(1, 4, 1)
sns.countplot(barca["Nationality"], color = "blue")
plt.xticks(rotation=90)
plt.title("FC Barcelona")

plt.subplot(1, 4, 2)
sns.countplot(madrid["Nationality"], color = "black")
plt.xticks(rotation=90)
plt.title("Real Madrid")

plt.subplot(1, 4, 3)
sns.countplot(liverpool["Nationality"], color = "red")
plt.xticks(rotation=90)
plt.title("Liverpool")

plt.subplot(1, 4, 4)
sns.countplot(mancity["Nationality"], color = "green")
plt.xticks(rotation=90)
plt.title("Manchester City")
plt.tight_layout()
plt.show()
In [81]:
cols = ["Preferred Foot", "International Reputation", 'Skill Moves']
for col in cols:
    plt.subplot(1, 4, 1)
    sns.countplot(barca[col])
    plt.title("FC Barcelona")
    plt.subplot(1, 4, 2)
    sns.countplot(madrid[col])
    plt.title("Real Madrid")
    plt.subplot(1, 4, 3)
    sns.countplot(liverpool[col])
    plt.title("Liverpool")
    plt.subplot(1, 4, 4)
    sns.countplot(mancity[col])
    plt.title("Manchester City")
    plt.tight_layout()
    plt.show()

BRAIN BEHIND SUCCESSFULL TEAMS

THE COACH/MANAGERS

LEFT : PEP GUARDIOLA, CLUBS : FC BARCELONA, FC BAYERN, MANCHESTER CITY

CENTER : ZINEDINE ZIDANE, CLUB : REAL MADRID

RIGHT : JURGEN KLOPP, CLUBS : BORUSSIA DORTMUND, LIVERPOOL

In [91]:
plt.figure(1, figsize = (15, 20))
img = mpimg.imread("managers.jpg") 
plt.imshow(img)
plt.show()

THEY PLAY A VITAL PART IN TEAMS SUCCESS